﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;

namespace WinFormLogger.Communication
{
    /// <summary>
    /// 处理消息事件
    /// </summary>
    public class MesseageEventArgs: EventArgs
    {

        public byte[] RawData { get; }
        public string Message { get; }
        public DateTime TimeStamp { get; }
        MessageDirection MessageDirection { get; }
        public object Tag { get; }
        /// <summary>
        /// 事件实例
        /// </summary>
        /// <param name="rawData"></param>
        /// <param name="message"></param>
        /// <param name="messageDirection"></param>
        /// <param name="tag"></param>
        public MesseageEventArgs(byte[] rawData,string message,MessageDirection messageDirection,object tag = null)
        {
            RawData = rawData;
            Message = message;
            TimeStamp = DateTime.Now;
            MessageDirection = messageDirection;
            Tag = tag;
        }
    }
    public enum MessageDirection 
    {
        Send, 
        Receive
    }

}
